package tråde;

class RunnableDemo {
	public static void main(String[] args) {
		Thread a = new Thread(
				new OutputRunnable('a') );
		Thread b = new Thread(
				new OutputRunnable('b') );
		a.start(); b.start();
	}
}

class OutputRunnable implements Runnable {
	private char c;
	OutputRunnable(char outputchar) {
		c = outputchar;
	}
	public void run() {
		for (int i=0; i<100; ++i) {
			System.out.print(c); System.out.flush();
		}
	}
}

